package com.bw.eureka.jpa.service;

import com.bw.common.dto.LogDto;
import com.bw.common.vo.ResultVO;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class LogServiceFactory implements FallbackFactory<LogService> {
    @Override
    public LogService create(Throwable throwable) {
        throwable.printStackTrace();
        return new LogService() {
            @Override
            public ResultVO saveLog(LogDto logDto) {
                return ResultVO.fail("500","服务器异常",null);
            }
        };
    }
}
